import 'package:dio/dio.dart';
import 'package:flutterproject/util/sp_util/shared_preferences.dart';
import 'package:flutterproject/util/sp_util/sp_key.dart';

class RequestInterceptor extends Interceptor {
  @override
  void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
    super.onRequest(options, handler);
    final token = SPUtils().getString(SPKey.token);
    if (token != "") options.headers['Authorization'] = token;
  }
}
